fetcher: Split lowlevel API into file/membuf variants
authorColin Walters <walters@verbum.org>
Wed, 28 Dec 2016 19:43:28 +0000 (14:43 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 4 Jan 2017 16:32:11 +0000 (16:32 +0000)
commit21aca3fa83d7365376f6be2056fc1bac33f9998d
treee5b1a9f8c4a7d7d7d6c6d2ced7d63790c216caad
parent9d0d0a26dbfa55080e580ed0bc7bb6c50ca46c21
fetcher: Split lowlevel API into file/membuf variants

The previous commit introduced a single low level API - however,
we can do things in a more optimal way for the curl backend if
we drop the "streaming API" variant.  Currently, we only use
it to synchronously splice into a memory buffer...which is pretty
silly when we could just do that in the backend.

The only tweak here is that we have an "add NUL character" flag that is
(possibly) needed when fetching into a membuf.

The code here ends up being better I think, since we avoid the double return
value for the `_finish()` invocation, and now most of the fetcher code (in the
soup case) writes to a `GOutputStream` consistently.

This will again make things easier for a curl backend.

Closes: #636
Approved by: jlebon
src/libostree/ostree-fetcher-util.c
src/libostree/ostree-fetcher.c
src/libostree/ostree-fetcher.h
src/libostree/ostree-repo-pull.c